package uk.co.itmentor.pmff.element;

import java.util.HashMap;
import java.util.Map;

import uk.co.itmentor.pmff.annotation.Orientation;
/**
 * Defines a section in te flat file which is organised vertically or horizontally.
 * @author mdylag
 *
 */
public class FFSection {
	/** Name of the section**/
	private String name;
	/** Map of the fields which are defined in the model*/
	private Map<String,FFField> fieldsDefined = new HashMap<String,FFField>();
	/** Map of the fields which was read from a flat file*/
	private Map<Integer,FFField> fieldsFromFile = new HashMap<Integer,FFField>();
	private Orientation orientation;

	

	/**
	 * Set a name of the section.
	 * @param name
	 */
	protected void setName(String name)
	{
		this.name = name;
	}
	
	/**
	 * Returns the section name.
	 */
	public String getName()
	{
		return this.name;
	}
	
	public Map<String,FFField> getFields()
	{
		return this.fieldsDefined;
	}
	
	protected void addField(FFField field)
	{
		this.fieldsDefined.put(field.getName(), field);
	}

	public boolean isVertical() {
		
		return false;
	}
	
	public Orientation getOrientation() {
		return orientation;
	}

	public void setOrientation(Orientation orientation) {
		this.orientation = orientation;
	}	
	
}
